﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using DotNet.Utilities;
using FtpLib;

namespace FTP_Test_Form
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        //FTPFactory myclient = new FTPFactory("192.168.2.127", "", "anonymous", "aaaaaa", 21);
        FTPClient myclient = new FTPClient("192.168.2.127", "", "anonymous", "aaaaaa", 21);
        

        private void button1_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            try
            {
                //long size = myclient.getFileSize("00.rmvb");
                //string[] str = myclient.getFileList("");

                //myclient.SetTransferType(FTPClient0.TransferType.ASCII);
                //string[] str = myclient.Dir("");
                long size = myclient.GetFileSize("00.rmvb");
                myclient.Get("00.rmvb", "e:\\Users\\Administrator\\Desktop\\", "01.rmvb");

                //foreach (string s in str)
                //{
                //    textBox1.Text += "\r\n" + s;
                //}
                textBox1.Text += "\r\n" + size.ToString();
            }
            catch (Exception er)
            {
                MessageBox.Show(er.ToString());
            }
            this.Cursor = Cursors.Default;
        }



       

       

        // end ------------------------------------------------------------------------------------
    }
}
